UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VDDDI0xdqPZHbd51KUBss2cxW/QVJUGoNO3vMsHQFuU='
WHERE
key_id = '08036516c834928906794ad4da3ef178500fb57394ee229312e3ce55e7db9561'
AND (
token = 'VDDDI0xdqPZHbd51KUBss2cxW/QVJUGoNO3vMsHQFuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)