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