UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fMJnSlJYOKyo8/hwbREdhTGYhN7FyzNpbcSn1ISlALk=' 
WHERE 
  key_id = '48d419a9993deb0911cb677292c5d9e9a5979dadff41674bc145368bb22c2e39' 
  AND (
    token = 'fMJnSlJYOKyo8/hwbREdhTGYhN7FyzNpbcSn1ISlALk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027