UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aNKpkj7Zhmib92p8JBxBiz3raxxmybvt5ZIiNX86MBA='
WHERE
key_id = '5331096cd671176f07a38fe42a511f7db492f981bfd6d8bfcfc8652cb9c0f4ff'
AND (
token = 'aNKpkj7Zhmib92p8JBxBiz3raxxmybvt5ZIiNX86MBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)