UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JkUbwlPeVHzKRMBxWgft4wl8rXT40goQD4kUDkXGohs='
WHERE
key_id = '880f6afcfbb25ad2f68a3f1e5dae40b72991ae744ed4104f27dfb8abb0936c4a'
AND (
token = 'JkUbwlPeVHzKRMBxWgft4wl8rXT40goQD4kUDkXGohs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)