UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '38IJ4ktLYgpXyXfOe654qS014KQnVMyy9lJNvavRa9I='
WHERE
key_id = 'd4cb2553dc48711f169971a0353223bd21a3739f6de4daff504ec403880c8208'
AND (
token = '38IJ4ktLYgpXyXfOe654qS014KQnVMyy9lJNvavRa9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)