UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kt/6KGJQgvC3vCjUOLWYks4JmQoTG37eB2MKc4jRjUc=' 
WHERE 
  key_id = '47de2da18fe90c8340e51dca1b9d8a026acc0dbf4664693fbf0d5ed61a5654b0' 
  AND (
    token = 'kt/6KGJQgvC3vCjUOLWYks4JmQoTG37eB2MKc4jRjUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030