UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLdjNYrkwYHokgpiESIwIRcHD6+MKEaqCMdLo8IBFpQ='
WHERE
key_id = '1a2a7b02c2fd974b566db5f88cadf4878967359c13306f8e14f712b1a6721474'
AND (
token = 'iLdjNYrkwYHokgpiESIwIRcHD6+MKEaqCMdLo8IBFpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)