UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGC6D1FlFnLqKkABMJNpcrZQaNIEiICzKceEJyVcvLI='
WHERE
key_id = '289fbf3c5bb3c2e522347899c7fca3de114531a7536d2aedcc7aceb7a7d72ebb'
AND (
token = 'UGC6D1FlFnLqKkABMJNpcrZQaNIEiICzKceEJyVcvLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)