UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7FPlxmUY2PC1GtFn7l2z2Y7NzEQAX7b+bcntO/APxuE=' 
WHERE 
  key_id = '6d12a8ae17e2752d4c37d3a5ec416f45445918a2d5d24f13ac25d562c3d7925b' 
  AND (
    token = '7FPlxmUY2PC1GtFn7l2z2Y7NzEQAX7b+bcntO/APxuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053