UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TIbTfdq01VxIic5pr58tVL7TyM3USfbRZcdruNVu0ls='
WHERE
key_id = '3e58423abb073c6eb9b685758c6ca3a4530da41e65e2fbc977be9cf98abff076'
AND (
token = 'TIbTfdq01VxIic5pr58tVL7TyM3USfbRZcdruNVu0ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)