UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ed1LshN35povrH+hijKByFuQQ0xAMHD20NORZo0WEnY='
WHERE
key_id = '41c5208e51e9cad2ca3f41edc51a5cf64860c82b7484f0644aefacaca914bb81'
AND (
token = 'ed1LshN35povrH+hijKByFuQQ0xAMHD20NORZo0WEnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)