UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hqyzjEZRMPmunJsq06mEisphaCxUvgOKe9HjOhsaHmE='
WHERE
key_id = '258d16517c5835d78a5d3d330ddb49f8096c919ad17ad40f219141a8b915b35a'
AND (
token = 'hqyzjEZRMPmunJsq06mEisphaCxUvgOKe9HjOhsaHmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)