UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XdxPl23w8Li0sFlFjGzCoOAxMcHLddLMUcZT9okqgY='
WHERE
key_id = '0be126f95d3b567f605c163616162c12bfef78a8bb065e34a824b91283c833ed'
AND (
token = '0XdxPl23w8Li0sFlFjGzCoOAxMcHLddLMUcZT9okqgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)