UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ySlfPjBxDfslzWAXp9npMHBxq1dIlsirPoipR275Zdk='
WHERE
key_id = 'f1367af5e77cab130151c483240899ce5308be63663e8c800561f07d6de4c6cb'
AND (
token = 'ySlfPjBxDfslzWAXp9npMHBxq1dIlsirPoipR275Zdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)