UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwSkLjyC69+P3HFPD6skLopHkXGQpf/gA1x0HLVwKQA='
WHERE
key_id = 'b1efb50dea11befb41dcad281ff98ddb26c707aec24fe112d3c1d888d537e838'
AND (
token = 'fwSkLjyC69+P3HFPD6skLopHkXGQpf/gA1x0HLVwKQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)