UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pSzoXVodOeKEJqkIOXdkyYNP5VifAi7TDKVvqe6X6Gs='
WHERE
key_id = '7ccf3c353120d8e1117a2893ac29da23a258ef8f5d29fabfee3d1aca920cfd65'
AND (
token = 'pSzoXVodOeKEJqkIOXdkyYNP5VifAi7TDKVvqe6X6Gs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)