UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcCJ9ykHBS5pUZlOGJrYg6Q4Jxlww5NEDlUoWEFQM7Q='
WHERE
key_id = '955ee3f9714f876ffdf7be9613580f2fb6de903c561b4cf09e416ce80547b94f'
AND (
token = 'bcCJ9ykHBS5pUZlOGJrYg6Q4Jxlww5NEDlUoWEFQM7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)