UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oiDqX8niJAg5gAijtMkbRjNysCXIjIDXUOcjN/skK5w='
WHERE
key_id = 'b6135ce1a837412fcdec1f7e764053193ac4c044e61dc69d4c4036eac5627714'
AND (
token = 'oiDqX8niJAg5gAijtMkbRjNysCXIjIDXUOcjN/skK5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)