UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1I4VPZBlKBQCcvh84TL1f/WQSiEAFaEL5Mp5TSjCoTg='
WHERE
key_id = '53d7a1cdd195bffdc2bfb5324bd03053bf798eee3947152522f46ea5b2f81382'
AND (
token = '1I4VPZBlKBQCcvh84TL1f/WQSiEAFaEL5Mp5TSjCoTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)